
<h1><?php echo $title; ?></h1>

<?php if (isset($notice) || $notice = $this->session->flashdata('notification')):?>
<p class="notice"><?php echo $notice;?></p>
<?php endif;?>



<form method='post' name="form1" id="form1" action="<?php echo site_url('adozioni/contabilita/offerte/ricevuta/' . $row['id']) ?>" >

<div class="form">

<div class="row">
<div class="col-md-2">

<label for="with_header">Con intestazione: </label>
</div>
<div class="col-md-10">
<input type="checkbox" name="with_header" value="1" />
</div>
</div>

<div class="row">
<div class="col-md-2">


<label for="testo"><?php echo __("Contenuto", $module) ?></label>

</div>
<div class="col-md-9">

<div class="toolbox">
<input type="button" id="{TITOLO}" class="btn button btn-primary" value="TITOLO"/>
<input type="button" id="{NOME}" class="btn button btn-primary" value="NOME"/>
<input type="button" id="{IMPORTO}" class="btn button btn-primary" value="IMPORTO"/>
<input type="button" id="{IMPORTO_IN_LETTERA}" class="btn button btn-primary" value="IMPORTO IN LETTERA"/>
<input type="button" id="{DATAOFFERTA}" class="btn button btn-primary" value="DATAOFFERTA"/>
<input type="button" id="{DATA}" class="btn button btn-primary" value="DATA"/>

</div>
<textarea  name="testo_ricevuta" id="testo_ricevuta" rows=10 class="form-control ckeditor" ><?php if($testo_ricevuta) echo $testo_ricevuta ?></textarea>

</div>
</div>


<div class="buttons">


<input type="submit" name="salva" id="submit" value=" <?php echo __("Salva contenuto", $module) ?> " class="btn btn-success"/>

<input type="submit" name="salva_e_stampa" id="submit" value=" <?php echo __("Salva e stampa", $module) ?> " class="btn btn-success"/>

<a  class="btn btn-primary" href="<?php echo site_url('adozioni/contabilita/offerte') ?>" ><?php echo __("Annulla", $module) ?></a>

</div>
</div>
<input type="hidden" name="id" value="<?php echo $row['id'] ?>" />
</form>

<script type="text/javascript">
function InsertHTML(html) {
	// Get the editor instance that we want to interact with.
	var editor = CKEDITOR.instances.testo_ricevuta;
	// Check the active editing mode.
	if ( editor.mode == 'wysiwyg' )
	{
		// Insert HTML code.
		// http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-insertHtml
		editor.insertHtml( " "+html );
	}
	else
		alert( 'You must be in WYSIWYG mode!' );
}

$(function(){

	$(".button").click(function(){
		InsertHTML($(this).attr('id'));
	
	});
});
</script>